package com.itheima.dao;

import com.github.pagehelper.Page;
import com.itheima.pojo.Role;
import com.itheima.pojo.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

public interface RoleDao {
    public Set<Role> findByUserId(Integer userId);

    void addRole(Role role);

    void setRoleIdAndMenuId(@Param("id") Integer id, @Param("menuIds") Integer[] menuIds);

    void setRoleIdAndPermissionId(@Param("id") Integer id, @Param("permissionIds") Integer[] permissionIds);

    Role selectRoleByKey(String keyword);

    Page<Role> selectByCondition(@Param("queryString") String queryString);

    Role findById(@Param("id") Integer id);

    void deleteRoleIdAndPermissionIds(@Param("id") Integer id);

    void deleteRoleIdAndMenuIds(@Param("id")Integer id);

    void updateRole(Role role);

    List<User> findUserByRoleId(@Param("id") Integer id);

    void deleteRoleById(@Param("id") Integer id);
}
